package com.rd.teacher.jichao.day01;

// 打印机工厂类
//   让计算机不需要关心  具体使用的是哪一台打印机  工厂类统一管理
public class OutputFactory {

    public Output getOutput(){
//        return new Printer();
        return new BetterPrinter();
    }

    public static void main(String[] args) {
//        Printer printer = new Printer();
//        BetterPrinter betterPrinter = new BetterPrinter();
        OutputFactory factory = new OutputFactory();
        Computer computer = new Computer(factory.getOutput());
        computer.print();
    }
}
